<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .grandfather {
            width: 300px;
            height: 300px;
            background: purple;
        }

        .father {
            width: 200px;
            height: 200px;
            background: gold;
            position: relative;
        }

        .son {
            width: 100px;
            height: 100px;
            background: red;
            left: 0;
            top: 400px;
            position: absolute;
        }

    </style>
    <script src="./js/jquery-1.12.4.min.js"></script>
    <script>
        $(function () {

            $('.son').click(function () {
                alert(1);
                // event.stopPropagation();  //阻止冒泡


            })

            $('.grandfather').click(function () {
                alert(3);
            })

            $('.father').click(function () {
                alert(2);

                return false;
            })



        })
    </script>
</head>
<body>
<div class="grandfather">
    <div class="father">
        <div class="son"></div>
    </div>
</div>
</body>
</html>